import React, { Component } from 'react'
import Child2 from './Child2'
import { CounterContext } from './Context'

// #4 使用 Provider 传递的数据的第二种方式
export default class Child1 extends Component {
  static contextType = CounterContext
  render() {
    return (
      <div>
        Child1: {this.context.count}
        <hr />
        <Child2 />
      </div>
    )
  }
}
